package org.dtrd.modules.record.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 血糖上下限
 * </p>
 *
 * @author QR
 * @since 2021-10-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dtrd_ent_rd_uplow_record")
@NoArgsConstructor
public class DtrdEntRdUplowRecord implements Serializable {


    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("patient_id")
    private Integer patientId;

    @TableField("doctor_id")
    private Integer doctorId;

    @TableField("uplow_record_upper_value")
    private Float uplowRecordUpperValue;

    @TableField("uplow_record_lower_value")
    private Float uplowRecordLowerValue;

    @TableField("uplow_record_limit_type")
    private Integer uplowRecordLimitType;

    @TableField("uplow_record_time_type")
    private String uplowRecordTimeType;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("update_time")
    private Date updateTime;

    public DtrdEntRdUplowRecord(Integer doctorId, Integer patientId) {
        this.doctorId = doctorId;
        this.patientId = patientId;
    }

    public DtrdEntRdUplowRecord init(){
        this.setIsDel(0);
        this.setUpdateTime(new Date());
        return this;
    }


    @Override
    public String toString() {
        return "DtrdEntRdUplowRecord{" +
                "patientId=" + patientId +
                ", uplowRecordUpperValue=" + uplowRecordUpperValue +
                ", uplowRecordLowerValue=" + uplowRecordLowerValue +
                ", uplowRecordLimitType=" + uplowRecordLimitType +
                ", uplowRecordTimeType='" + uplowRecordTimeType + '\'' +
                '}';
    }
}
